/*
The surface-physics project: http://code.google.com/p/surface-physics/
Adds real world physics based on the Bullet physics engine, to bases in the Orbiter space
flight simulation software.

Written by Abhijit Nandy
License : Apache License 2.0

Bump_ExternalStaticGeometry.h
This class is a Component based object, specifically for external static geometry

It may require updates only to load/unload meshes when the camera is outside the base
Or for Level-of-Detail texturing.


TODO: This class should read the options section of an object from the physics file
TODO: Smart loading of meshes and creation/deletion of static geometry in Bullet to ensure fps.

*/


#pragma once


#include "../BulletBase/Bump_BaseObject.h"


// Forward Declarations
class Bump_CollisionShape;



/**
 * The Bump_Attachment to create and manage a BulletBase
 */
class Bump_ExternalStaticGeometry : public Bump_BaseObject
{
	static Registrar registrar;

	// Temporary, base specific geometry which should be parsed from file
	void brightonSpecificGeometry();
	void olympusSpecificGeometry();


public:
	static Bump_BaseObject * create() { return new Bump_ExternalStaticGeometry; }

	Bump_ExternalStaticGeometry();
	virtual ~Bump_ExternalStaticGeometry();

	//Main control functions which are overidden from parent as they are called from Bump_BulletBase
	int		clbkSetClassCaps(InitialObjectData& initialData);
	int		clbkPreStep(double SimT, double SimDT, double MJD);

	//Utility stuff
	int		createOrbiterPrimitives();
	int 	destroyOrbiterPrimitives();
	int 	createBulletPad(btScalar rposX,
			 btScalar rposY,
			 btScalar rposZ);
	int		createBulletRigidBody();
	int		destroyBulletRigidBody();
	int		processCommand();


};
